Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV 4.3.0 Error: Assertion failed (tlsSlots.size() > slotIdx) in releaseSlot #17264

Closed
3 of 4 tasks
bendell02 opened this issue May 11, 2020 · 5 comments
Closed
3 of 4 tasks

Comments

@bendell02
Copy link

System information (version)
  • OpenCV => 4.3
  • Operating System / Platform => ubuntu 16.04 64Bit And ubuntu 18
  • Compiler => gcc 5.4.0
Detailed description

Dynamic library libK.so has used static library of OpenCV 3.2.

Then Program P used the libK.so and OpenCV 4.3.0.

Once P use the Mat data from libK.so, error is raised when P terminated.
The error message is as follows:

OpenCV Error: Assertion failed (tlsSlots.size() > slotIdx) in releaseSlot, file /home/smarteye07/download/opencv/opencv320_static/modules/core/src/system.cpp, line 1092
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/opencv/opencv320_static/modules/core/src/system.cpp:1092: error: (-215) tlsSlots.size() > slotIdx in function releaseSlot

The problem is at class TlsStorage of "system.cpp".
Then I check the commit log of OpenCV, I found that TlsStorage has been revised 5 months ago.
May be this error is introduced by this revision.

So I try the version OpenCV 4.1.1 that has no this revision. OpenCV 4.1.1 has no this error. And OpenCV 3.2.0 has no this error too.

Steps to reproduce
  1. generate a dynamic library libK.so that used static library of OpenCV 3.2. And libK.so provide a interface like "cv::Mat getImage()"
  2. write a program P that use libK.so and OpenCV. but this time OpenCV is 4.3.0 version.
  3. P call the interface "cv::Mat getImage()"
  4. when P is terminated, the error occurs.
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc
@alalek
Copy link
Member

alalek commented May 11, 2020

Dynamic library libK.so has used static library of OpenCV 3.2.

Ensure that all OpenCV-related symbols are hidden (using "nm" / "readelf" tools) to avoid possible conflicts.

@ShrutheeshIR
Copy link

Hello
I am facing the same issue (more or less). My opencv version is 4.1.2. However, while running a code I get such an error.

what(): /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/system.cpp:1092: error: (-215) tlsSlots.size() > slotIdx in function releaseSlot
Were you able to solve it?

@alalek
Copy link
Member

alalek commented Jun 26, 2020

My opencv version is 4.1.2
opencv-3.2.0+dfsg

You have mess with different OpenCV versions.

Try to run with enabled LD_DEBUG=files and inspect output.

@AhmedHumais
Copy link

Hello
I am facing the same issue (more or less). My opencv version is 4.1.2. However, while running a code I get such an error.

what(): /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/system.cpp:1092: error: (-215) tlsSlots.size() > slotIdx in function releaseSlot
Were you able to solve it?

I am facing the same issue. Anyone knows how to solve it?

@alalek
Copy link
Member

alalek commented Sep 28, 2020

We don't support configuration with multiple different OpenCV versions in one application address space.
You should align these versions including dependencies on your side.

(static compilation with completely hidden symbols may help partially)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants